﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using scheduleMVC.Models;
using Microsoft.AspNet.Identity;
using scheduleMVC.DAL;

namespace scheduleMVC.Controllers
{
    public class EmployeeController2 : Controller
    {
        //
        // GET: /Employee/
        public ActionResult Index()
        {
            return View("EmployeeLogin");
        }

        //Index to list all employees
        // GET: /Employee/
        
        
        public ActionResult Employees()
        {

            return View();
               
            
          
        }



        













        //
        // GET: /Employee/Details/5
        //public ActionResult Details(string id)
        //{
        //    if (id == null)
        //    {
        //        return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        //    }
        //    //Create the object for the Employee
        //    var employeeDB = new EmployeeContext();

        //    var employees = employeeDB.Employees.Find(id);
            
        //    if (employees == null)
        //    {
        //        return HttpNotFound();
        //    }
        //    return View(employees);
        //}

        //
        // GET: /Employee/Create
        public ActionResult Create()
        {
            return View();
        }

        ////
        //// POST: /Employee/Create
        //[HttpPost]
        //public ActionResult Create(FormCollection collection)
        //{
        //    try
        //    {
        //        // TODO: Add insert logic here

        //        return RedirectToAction("Index");
        //    }
        //    catch
        //    {
        //        return View();
        //    }
        //}

        //
        // GET: /Employee/Edit/5
        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /Employee/Edit/5
        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Employee/Delete/5
        //public ActionResult Delete(String id)
        //{
        //    if (id == null)
        //    {
        //        return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        //    }
        //    //Create the object for the Employee
        //    var employeeDB = new EmployeeContext();

        //    var employees = employeeDB.Employees.Find(id);
        //    if (employees == null)
        //    {
        //        return HttpNotFound();
        //    }
        //    return View(employees);
        //}

        //
        // POST: /Employee/Delete/5
        [HttpPost]
        public ActionResult Delete(string id, FormCollection collection)
        {
            try
            {
              
                return RedirectToAction("Employees");

            }
            catch
            {
                return View();
            }
        }
    }
}
